package com.syllabus.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.db.DatabaseHelper;

public class GetDeptServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		
		resp.setContentType("text/plain");
		String value = null;
		try {
			value = DatabaseHelper.getDepartments().toString();
		} catch (Exception e) {
			e.printStackTrace();
		}
		resp.getWriter().write(value.substring(1, value.length() - 1));
	}

}
